Problem saving filtered view

I am using DXL to create some views, which need to be filtered, but I can't get the views to save the filter. Once the view is created, the filter is there, but then if I go to another view and back, it is no longer filtered. I am having to manually save it again using View-Save As. I'm not sure what I'm doing wrong.

Here is what I am doing:



Module Mod = current
Object obj
string standardViewName = "Standard view"
string viewName = "Qual Plan VCRM - Evidence"

load view standardViewName

View v = view(viewName)

ViewDef vdef = get(current, v)
useColumns(vdef, true)
useFiltering(vdef, true)
Column col0 = column(Mod,0)
Column col1 = column(Mod,1)
Column col2 = insert(column 2)
Column col3 = insert(column 3)
Column col4 = insert(column 4)
Column col5 = insert(column 5)
width(col0, 75)
justify(col0,left)
attribute(column 0, "attr_Module_Name")
title(col0, "Module_Name")

width(col1, 125)
justify(col1,left)
attribute(column 1, "attr_Object_Identifier")
title(col1, "Object_Identifier")

width(col2, 125)
justify(col2,left)
attribute(column 2, "attr_Para Num")
title(col2, "Heading Number")

width(col3, 125)
justify(col3,left)
attribute(column 3, "attr_Para Title")
title(col3, "Heading")

width(col4, 300)
justify(col4,left)
attribute(column 4, "attr_Object Text")
title(col4, "Requirement")

width(col5, 150)
justify(col5,left)
attribute(column 5, "attr_Primary Evidence")
title(col5, "Evidence")

for obj in Mod do {
reject obj
}
for obj in Mod do {
string strReq = obj."attr_Primary Evidence" ""
if (strReq != "")
accept obj
}
filtering on

refresh current

save(Mod, v, vdef)
lnorton - Tue Aug 04 15:23:54 EDT 2009

Re: Problem saving filtered view
IBM_Gust - Tue Aug 04 15:45:34 EDT 2009

Views will not save object that are filtered using accept & reject.

You will have to create a differnt type of filter to save in view.

Re: Problem saving filtered view
lnorton - Tue Aug 04 16:07:07 EDT 2009

IBM_Gust - Tue Aug 04 15:45:34 EDT 2009
Views will not save object that are filtered using accept & reject.

You will have to create a differnt type of filter to save in view.

Thanks! I used Filter f = notNull(attribute("attr_Primary Evidence")) instead and it worked great!